$NG.AllReady(function (page, { useAction, useBeforeClick, useValuesChange, useClick, useUpdateRow, subscribe, useUpdateRows }) {
    const mstform = $NG.getCmpApi("p_form_zbtz_m")
    const dgrid1 = $NG.getCmpApi("")
    const getHeadValue = (str)=>mstform.getItem(str).getValue()

    useValuesChange(()=>{
        getXmkInfoByPhid()
    },"p_form_zbtz_m.u_xmmc")

    // 获取项目库信息
    function getXmkInfoByPhid(){
        const phid = getHeadValue("u_xmmc")
        if(!phid) return 
        $NG.execServer("getXmkInfoByPhid",{phid},(res)=>{
            if(res.count == 0) return 
            const datas = JSON.parse(res.data)[0].extendObjects
            $NG.updateState((updater)=>{
                updater.data.p_form_zbtz_m.setProps({
                    bill_no:datas.u_xmbh,
                    u_zbzje:datas.u_ztzje,
                    u_yzmc:{
                        label:datas.yzdw_name,
                        value:datas.yzdw_phid
                    }
                })
            })
        })
    }
})
